WIP impact diagnostics fns#17
Conversation
…ots central impact estimates, coverage and fvps. Associated documentation also added from attempts at roxygen!
| #' @export | ||
| plot_impact <- function( | ||
| data, | ||
| country = PINE, |
There was a problem hiding this comment.
I think this will fail for certain diseases. Although we use PINE as a default for a quick glace at estimates instead of running every country, there will not be some diseases in PINE countries, for example YF.
There was a problem hiding this comment.
Could we add something like, if some or any of PINE present, plot those? Likely at least one PINE country will be present in all disease datasets.
There was a problem hiding this comment.
I think a failure for a disease-country mismatch is okay, we provide PINE as a sensible default but there's no expectation that country is always present - the function will error informatively, and the user can change either data or country.
| ggplot2::geom_line(aes(colour = .data$short_name), linewidth = 0.5) + | ||
| ggplot2::geom_point(aes(colour = .data$short_name), size = 0.5) + | ||
| theme_vimc() + | ||
| facet_wrap(ggplot2::vars("country"), scales = "free_y") + |
There was a problem hiding this comment.
I think the facet_wrap should be facet_wrap(ggplot2::vars(country), scales = "free_y") to correctly facet the plots into countries
| labs( | ||
| x = x_lab, | ||
| y = glue::glue("{burden_type} averted"), | ||
| title = title |
There was a problem hiding this comment.
Add two labs to make the legend title more intuitive:
fill = "Vaccination activity", colour = "Vaccination activity"
| labs( | ||
| x = "Year", | ||
| y = ylab, | ||
| title = title |
There was a problem hiding this comment.
Same comment re tidying up legend title:
fill = "Vaccination acitivty", colour = "Vaccination activity"
| ggplot( | ||
| data, | ||
| aes( | ||
| x = .data$year, |
There was a problem hiding this comment.
Years are being plotted with 2 dp. not sure what the easiest way to deal with it is, force as.integer?
This PR is WIP replacing #15.
PR desc copied over:
This PR adds additional functions from [https://github.com/vimc/montagu-reports/tree/main/src/rapid-model-run-impact] a key report for the VIMC Science & Policy team.
Functions added generate central estimate impact plots and coverage and fvp plots per year, country and view.
First attempt at ensuring functions are package-ready/ utilising roxygen etc. so any comment welcome.
TODO's in script fn_plotting_impact.R with specific questions. I understand testing may need to be stronger/ the next step.